home *** CD-ROM | disk | FTP | other *** search
- Path: news.gate.net!rdl-ilps-rxh2
- From: rmcinnis@gate.net (Robert B McInnis)
- Newsgroups: comp.lang.c++
- Subject: Additions to the STL : Callback/Observer pair
- Date: 4 Apr 1996 14:31:55 GMT
- Organization: 9th Bit Software
- Message-ID: <4k0mgr$1iog@news.gate.net>
- NNTP-Posting-Host: miafl2-31.gate.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
-
- I would like to propose a Callback/Observer construct for the Standard
- Template Library. This could be a base class pair with the Observer being
- primarily templates. This would allow for a consistent Callback/Observer
- pattern to be used across applications. This would also familiarize people
- with the pattern and promote different design decisions when designing an app.
-
- The Callback class should be a simple list of Observers that the owner, or
- possibly anyone, depending on access, would be able to invoke or disable.
-
- An Observer should be dynamic enough so that if the receiver instance, that is
- attached directly to the Observer instance, were to be deleted, then the
- Observer object would know to just disable its node on its associated Callback
- list.
-
- This would lead to the concept of Observible destruction of objects.
-
- What about observible construction on a class. This would allow my class to
- know when an instance of itself has been created, then fire off an initialize
- VIRTUAL, since this really can't be done in the constructor without EVERY
- descendent having to know about the initialize method.
-
- This would eventually allow for observible files on a file system. Imagine
- that! Biff would be a trivial app (even on DOS) without a polling mechanism.
- Or maybe just for version control, to know when certain files have updated on
- a LARGE network based development effort.
-
- Just a thought. If anyone is actually listening, it'd be nice to know what's
- thought of this. Need an example of a callback/observer pair? Just eMail me.
-
- Thanks for the time,
-
- Rob
-
- ---------------------------
- Robert McInnis
- 9th Bit Software
- (eMail) rmcinnis@gate.net
- (web ) http://www.gate.net/~rmcinnis
-
-